<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS+jquery示范</title>
    <script src="jquery-3.5.1.min.js"></script>
</head>
<body>

    <div>
        这是一个div<br/>
        <span id = "span1">第一个span</span><br/>
        <span id = "span2">第二个span</span><br/>
    </div>
    

    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>

    <ol>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ol>

    <script>
        $("div").click(function(){
            alert("点击了div")
        })

        console.log($("div").text());
        console.log($("div").html());

        $("span").click(function(){
            console.log($("#span1").text("<span>哈哈</span>"));
            console.log($("#span1").html("<span>哈哈</span>"));

            console.log($("#span1").text());
            console.log($("#span2").html());
        })

        $("ul").append("append");
        $("ul").prepend("prepend");
        $("ul").before("before");
        $("ul").after("after");

    </script>
</body>
</html>